<?php
class Back_Form_GalerieAlbums extends Jnd_Form
{
    private $_utilisateurs = array();

    public function __construct( $decorateur = "Formulairejndpro", $options = null )
    {
        if (isset($options["utilisateurs"])) {
            $this->_utilisateurs = $options['utilisateurs'];
            unset($options['utilisateurs']);
        }
        parent::__construct($decorateur, $options);
        $this->setElementDecorators(array(
            "$decorateur"
        ), array(), false);
    }

    public function init()
    {
        $this->setAction('/back/galerie-albums/editer');
        $this->setName("galeriealbum");
        $this->setMethod("post");
        $this->addAttribs(array(
            "class" => "cssform"
        ));
        
        $champ = new Zend_Form_Element_Hidden("id");
        $champs[] = $champ;
        
        $champ = new Zend_Form_Element_Select("proprietaire");
        $champ->setLabel(__("Propriétaire"));
        $champ->setRequired(true);
        $champ->setMultiOptions($this->_utilisateurs);
        $champs[] = $champ;
        
        $champ = new Zend_Form_Element_Text("titre");
        $champ->setLabel(__("Titre"));
        $champ->setRequired(true);
        $champs[] = $champ;
        
        $this->addElements($champs);
    }
}

